<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - self_test2.info - strings/apr_strtok.c</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">strings</a> - apr_strtok.c<span style="font-size: 80%;"> (source / <a href="apr_strtok.c.func.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">self_test2.info</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">15</td>
            <td class="headerCovTableEntry">15</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2011-07-03</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td></td>
            <td></td>
            <td></td>
            <td class="headerItem">Branches:</td>
            <td class="headerCovTableEntry">16</td>
            <td class="headerCovTableEntry">26</td>
            <td class="headerCovTableEntryLo">61.5 %</td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">           Branch data     Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>                :            : /* Licensed to the Apache Software Foundation (ASF) under one or more</a>
<span class="lineNum">       2 </span>                :            :  * contributor license agreements.  See the NOTICE file distributed with
<span class="lineNum">       3 </span>                :            :  * this work for additional information regarding copyright ownership.
<span class="lineNum">       4 </span>                :            :  * The ASF licenses this file to You under the Apache License, Version 2.0
<span class="lineNum">       5 </span>                :            :  * (the &quot;License&quot;); you may not use this file except in compliance with
<span class="lineNum">       6 </span>                :            :  * the License.  You may obtain a copy of the License at
<span class="lineNum">       7 </span>                :            :  *
<span class="lineNum">       8 </span>                :            :  *     http://www.apache.org/licenses/LICENSE-2.0
<span class="lineNum">       9 </span>                :            :  *
<span class="lineNum">      10 </span>                :            :  * Unless required by applicable law or agreed to in writing, software
<span class="lineNum">      11 </span>                :            :  * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
<span class="lineNum">      12 </span>                :            :  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<span class="lineNum">      13 </span>                :            :  * See the License for the specific language governing permissions and
<span class="lineNum">      14 </span>                :            :  * limitations under the License.
<span class="lineNum">      15 </span>                :            :  */
<span class="lineNum">      16 </span>                :            : 
<span class="lineNum">      17 </span>                :            : #ifdef HAVE_STDDEF_H
<span class="lineNum">      18 </span>                :            : #include &lt;stddef.h&gt;        /* for NULL */
<span class="lineNum">      19 </span>                :            : #endif
<span class="lineNum">      20 </span>                :            : 
<span class="lineNum">      21 </span>                :            : #include &quot;apr.h&quot;
<span class="lineNum">      22 </span>                :            : #include &quot;apr_strings.h&quot;
<span class="lineNum">      23 </span>                :            : 
<span class="lineNum">      24 </span>                :            : #define APR_WANT_STRFUNC   /* for strchr() */
<span class="lineNum">      25 </span>                :            : #include &quot;apr_want.h&quot;
<a name="26"><span class="lineNum">      26 </span>                :            : </a>
<span class="lineNum">      27 </span>                :            : APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last)
<span class="lineNum">      28 </span>                :<span class="lineCov">         30 : {</span>
<span class="lineNum">      29 </span>                :            :     char *token;
<span class="lineNum">      30 </span>                :            : 
<span class="lineNum">      31 </span>        [<span class="branchCov" title="Branch 0 was taken 19 times"> + </span><span class="branchCov" title="Branch 1 was taken 11 times"> + </span>]:<span class="lineCov">         30 :     if (!str)           /* subsequent call */</span>
<span class="lineNum">      32 </span>                :<span class="lineCov">         19 :         str = *last;    /* start where we left off */</span>
<span class="lineNum">      33 </span>                :            : 
<span class="lineNum">      34 </span>                :            :     /* skip characters in sep (will terminate at '\0') */
<span class="lineNum">      35 </span>[<span class="branchCov" title="Branch 0 was taken 62 times"> + </span><span class="branchCov" title="Branch 1 was taken 12 times"> + </span>][<span class="branchNoCov" title="Branch 3 was not taken"> - </span><span class="branchCov" title="Branch 4 was taken 62 times"> + </span>]:<span class="lineCov">         74 :     while (*str &amp;&amp; strchr(sep, *str))</span>
<span class="lineNum">         </span>[<span class="branchNoExec" title="Branch 5 was not executed"> # </span><span class="branchNoExec" title="Branch 6 was not executed"> # </span>][<span class="branchNoExec" title="Branch 8 was not executed"> # </span><span class="branchNoExec" title="Branch 9 was not executed"> # </span>]
<span class="lineNum">         </span>        [<span class="branchCov" title="Branch 11 was taken 44 times"> + </span><span class="branchCov" title="Branch 12 was taken 18 times"> + </span>]
<span class="lineNum">      36 </span>                :<span class="lineCov">         44 :         ++str;</span>
<span class="lineNum">      37 </span>                :            : 
<span class="lineNum">      38 </span>        [<span class="branchCov" title="Branch 0 was taken 12 times"> + </span><span class="branchCov" title="Branch 1 was taken 18 times"> + </span>]:<span class="lineCov">         30 :     if (!*str)          /* no more tokens */</span>
<span class="lineNum">      39 </span>                :<span class="lineCov">         12 :         return NULL;</span>
<span class="lineNum">      40 </span>                :            : 
<span class="lineNum">      41 </span>                :<span class="lineCov">         18 :     token = str;</span>
<span class="lineNum">      42 </span>                :            : 
<span class="lineNum">      43 </span>                :            :     /* skip valid token characters to terminate token and
<span class="lineNum">      44 </span>                :            :      * prepare for the next call (will terminate at '\0) 
<span class="lineNum">      45 </span>                :            :      */
<span class="lineNum">      46 </span>                :<span class="lineCov">         18 :     *last = token + 1;</span>
<span class="lineNum">      47 </span>[<span class="branchCov" title="Branch 0 was taken 142 times"> + </span><span class="branchCov" title="Branch 1 was taken 8 times"> + </span>][<span class="branchNoCov" title="Branch 3 was not taken"> - </span><span class="branchCov" title="Branch 4 was taken 142 times"> + </span>]:<span class="lineCov">        150 :     while (**last &amp;&amp; !strchr(sep, **last))</span>
<span class="lineNum">         </span>[<span class="branchNoExec" title="Branch 5 was not executed"> # </span><span class="branchNoExec" title="Branch 6 was not executed"> # </span>][<span class="branchNoExec" title="Branch 8 was not executed"> # </span><span class="branchNoExec" title="Branch 9 was not executed"> # </span>]
<span class="lineNum">         </span>        [<span class="branchCov" title="Branch 11 was taken 132 times"> + </span><span class="branchCov" title="Branch 12 was taken 10 times"> + </span>]
<span class="lineNum">      48 </span>                :<span class="lineCov">        132 :         ++*last;</span>
<span class="lineNum">      49 </span>                :            : 
<span class="lineNum">      50 </span>        [<span class="branchCov" title="Branch 0 was taken 10 times"> + </span><span class="branchCov" title="Branch 1 was taken 8 times"> + </span>]:<span class="lineCov">         18 :     if (**last) {</span>
<span class="lineNum">      51 </span>                :<span class="lineCov">         10 :         **last = '\0';</span>
<span class="lineNum">      52 </span>                :<span class="lineCov">         10 :         ++*last;</span>
<span class="lineNum">      53 </span>                :            :     }
<span class="lineNum">      54 </span>                :            : 
<span class="lineNum">      55 </span>                :<span class="lineCov">         30 :     return token;</span>
<span class="lineNum">      56 </span>                :            : }
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.9</a></td></tr>
  </table>
  <br>

</body>
</html>
